import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/login'
import Home from '@/views/home'
import welcome from '@/components/Welcome.vue'
import Article from '@/components/article'
import Publish from '@/components/publish'
import Images from '@/components/image'
import Comment from '@/components/comment'
import Setting from '@/components/setting'
import Fans from '@/components/fans'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/login' },
  { path: '/login', component: Login },
  {
    path: '/home',
    component: Home,
    redirect: '/welcome',
    children: [
      { path: '/welcome', component: welcome },
      { path: '/article', component: Article },
      { path: '/publish', component: Publish },
      { path: '/image', component: Images },
      { path: '/comment', component: Comment },
      { path: '/setting', component: Setting },
      { path: '/fans', component: Fans }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
